﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using St.BLL;
using St.MODLD;

namespace Goods
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2) 
            {
                tBxshuru.Focus();
            }
        }
        private void tBxshuru_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (tBxshuru.Text != null)
                {
                    btnsousuo_Click(null,null);
                }
            }
            
        }

        private void btnsousuo_Click(object sender, EventArgs e)
        {
            GoodsService Goods = new GoodsService();
            List<GoodsInfo> list = Goods.dd(tBxshuru.Text);
            if (list.Count == 0) 
            {
                MessageBox.Show("商品编号输入错误");
            }
            else if (list.Count == 1)
            {
                List<BuyGoodsInfo> BuyGoods = new List<BuyGoodsInfo>();

            }
            else 
            {
            
            }


        }

        private void Form1_Load(object sender, EventArgs e)
        {
            dgvGoods.AutoGenerateColumns = false;
        }
    }
}
